<%@page import="dao.JPAHiberDAOFactory"%>
<%@page import="model.entity.product.Brand"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="kendo" uri="http://www.kendoui.com/jsp/tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html lang="en">

<head>
	<meta charset="utf-8"/>
	<title>Manager Panel</title>
	
	<%@include file="headerLink.jsp" %>
</head>


<body>
	<%
		if(session.getAttribute("manager") == null) {
		String url = "../BrandContr";
	%>
	
	<jsp:include page="header.jsp"></jsp:include>
	
	<jsp:include page="menu.jsp"></jsp:include>
	
	<section id="main" class="column">	
		<kendo:grid name="brandGrid" pageable="true" groupable="true" sortable="true" filterable="true">
        <kendo:grid-columns>
            <kendo:grid-column title="ID" field="brandId" />
            <kendo:grid-column title="Brand Name" field="name"/>
            <kendo:grid-column title="Desciption" field="description" />
            <kendo:grid-column title="Logo" field="logo" />
        </kendo:grid-columns>
        <kendo:dataSource pageSize="3" serverPaging="false">        
            <kendo:dataSource-schema>
                <kendo:dataSource-schema-model>
                    <kendo:dataSource-schema-model-fields>
                        <kendo:dataSource-schema-model-field name="brandId" type="number" />
                        <kendo:dataSource-schema-model-field name="name" type="string" />
                        <kendo:dataSource-schema-model-field name="description" type="string" />
                        <kendo:dataSource-schema-model-field name="logo" type="string" />
                    </kendo:dataSource-schema-model-fields>
                </kendo:dataSource-schema-model>
            </kendo:dataSource-schema>
            <kendo:dataSource-transport>
                <kendo:dataSource-transport-read url="<%=url%>"/>
            </kendo:dataSource-transport>
        </kendo:dataSource>
    </kendo:grid>
    <div style="width: 100%;" class="editorTable">
    <kendo:editor name="ege">
    </kendo:editor>
    </div>
	</section>
	<%
		} else {
	%>
		<script type="text/javascript">
			$.confirm({
		        'title': 'Not Authorized',
		        'message': 'You need to login first!!',
		        'buttons': {
		            'OK': {
		                'class': 'blue',
		                'action': function () {
		                	window.location.href="manager_login.jsp";
		                }
	
		            }
		        }
		    });
		</script>
	<%
		}
	
	%>
</body>

</html>